#pragma once

#include <iostream>
#include <memory>
#include <string>

class Shape;

class ShapeFactory
{
public:
    virtual std::unique_ptr<Shape> generate() = 0;
};

class Shape
{
public:
    virtual void draw() = 0;
    virtual ~Shape() {}
};

class Square : public Shape
{
public:
    Square(){}
    virtual void draw() override
    {
        std::cout << "Square's draw\n";
    }
};

class SquareFactory : public ShapeFactory
{
public:
    virtual std::unique_ptr<Shape> generate() override
    {
        return std::make_unique<Square>();
    }
};

class Circle : public Shape
{
public:
    virtual void draw() override
    {
        std::cout << "Circle's draw\n";
    }
};

class CircleFactory : public ShapeFactory
{
public:
    virtual std::unique_ptr<Shape> generate() override
    {
        return std::make_unique<Circle>();
    }
};


class Triangle : public Shape
{
public:
    virtual void draw() override
    {
        std::cout << "Triangle's draw\n";
    }
};

class TriangleFactory : public ShapeFactory
{
public:
    virtual std::unique_ptr<Shape> generate() override
    {
        return std::make_unique<Triangle>();
    }
};